﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FinosLibrary;
using FinosServiceLibrary.Server;
using System.Xml.Serialization;
using System.Data;
using System.IO;
namespace BattleShip {
    [MessageProcess(MPType.PropServer)]
    public class PSUserList : ServerLogic {
        [AutoWire]
        public DataClassesDataContext database;
        [MessageMethod]
        public void GetUserNum(AdminClient client) {
            call(client, "GotUserNum", database.Users.Count());
        }

        [MessageMethod]
        public void GetUserList(AdminClient client,int page) {
            var result = database.Users.Skip(page * Static.PageSize).Take(Static.PageSize);
            call(client, "GotUserList", result.ToArray());
        }
    }
}
